#from django.db import models
# Create your models here.
from django.db import models

class SiteManager(models.Manager):
    def create_site(self, name, file_name):
        site = self.create(name=name,file_name=file_name)
        # do something with the book
        return site

class Site(models.Model):
    name = models.CharField(max_length=200)
    file_name = models.CharField(max_length=200)
    objects = SiteManager()

class AccessLog(models.Model):
    site = models.ForeignKey(Site)
    ip_address = models.CharField(max_length=200)
    date_time = models.IntegerField(default=0)
    request_method = models.CharField(max_length=10)
    resource = models.CharField(max_length=300)
    response_code = models.IntegerField(default=0)
    size= models.IntegerField(default=0)
    referer = models.CharField(max_length=300)
    os = models.CharField(max_length=100)
    dist = models.CharField(max_length=50)
    dist_version = models.CharField(max_length=50)
    browser = models.CharField(max_length=100)
    browser_version = models.CharField(max_length=50)
    user_agent = models.CharField(max_length=500)
